<html>
<head>
    <#assign basePath=request.contextPath>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>后台管理系统</title>
    <link href="${basePath}/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="${basePath}/bootstrap/css/font-awesome.min.css" rel="stylesheet">
    <link href="${basePath}/bootstrap/css/form.lzy.css" rel="stylesheet">
    <link href="${basePath}/bootstrap/css/good.lzy.css" rel="stylesheet">
    <link rel="icon" href="${basePath}/images/favicon.png" type="image/x-icon" />
    <link rel="shortcut icon" href="${basePath}/images/favicon.png" type="image/x-icon" />
    <link rel="bookmark" href="${basePath}/images/favicon.png" type="image/x-icon" />
    <style>
        #business label{ display: inline-block; margin-right: 10px;}
        #business label input{ margin-right: 5px; position: relative; top: 2px;}
        .input-file {left:3px;}
        .form-group .btn-box button {margin-left:0; }
        .image-text .btn-box button{ display: block; line-height: 26px; margin-bottom: 2px;}
    </style>
</head>
<body style="background-color: #F2F2F2;">

<div class="panel panel-f5 tenants">
    <h1>请完善以下资料</h1>
    <div class="panel-body row tip-con">

        <form id="myForm" class="form-horizontal"  method="post" enctype="multipart/form-data">
            <input type="hidden" id="_ctx" value="${basePath}"/>
            <input type="hidden" id="shopId" name="shopAppId" value="">
            <div class="form-group">
                <span class="control-label col-sm-3 col-xs-5 detail-span"><font color="red">*</font>申请身份类型：</span>
                <div class="col-sm-9 col-xs-7">
                    <select id="module" name="type" class="form-control">
                        <option value="">请选择</option>
                        <option value="1" data-name="group-trip" data-id="9000">旅游创客</option>
                        <option value="2" data-name="group-play" data-id="5000">玩什么项目商家</option>
                        <%--<option value="3" data-name="group-shop" data-id="1000">商城商家</option>--%>
                        <option value="4" data-name="group-club" data-id="2000">俱乐部房车租赁</option>
                        <option value="5" data-name="group-person" data-id="2000">个人房车租赁</option>
                        <option value="6" data-name="group-car" data-id="3000">房车生产商</option>
                        <option value="7" data-name="group-camping" data-id="4000">露营地企业</option>
                    </select>
                </div>
            </div>
            <div class="group-box">
                <%@ include file="/WEB-INF/views/admin/tenants_instr.jsp"%>
                <div class="form-group group-trip group-person">
                    <span class="control-label col-sm-3 col-xs-5 detail-span"><font color="red">*</font>姓名：</span>
                    <div class="col-sm-9 col-xs-7">
                        <input class="form-control" size="30" name="name" value="" type="text" minlength="2" maxlength="20" placeholder="请输入您的姓名，最少2字符">
                    </div>
                </div>
                <div class="form-group group-trip group-person">
                    <span class="control-label col-sm-3 col-xs-5 detail-span"><font color="red">*</font>身份证号：</span>
                    <div class="col-sm-9 col-xs-7">
                        <input class="form-control" size="30" name="idCardNo" value="" type="text" maxlength="18" placeholder="请输入您的身份证号">
                    </div>
                </div>
                <div class="form-group group-shop">
                    <span class="control-label col-sm-3 col-xs-5 detail-span"><font color="red">*</font>&nbsp;所属板块：</span>
                    <div class="col-sm-9 col-xs-7 module">
                        <label><input name="modules" value="1000" type="checkbox" /> &nbsp;户外装备</label>
                        <%--<label><input name="modules" value="7000" type="checkbox" /> &nbsp;积分商城</label>--%>
                    </div>
                </div>
                <div class="form-group group-play group-club group-car group-shop group-camping">
                    <span class="control-label col-sm-3 col-xs-5 detail-span"><font color="red">*</font>企业名称：</span>
                    <div class="col-sm-9 col-xs-7">
                        <input class="form-control" size="30" name="companyName" value="" type="text" maxlength="20" placeholder="请输入您的企业姓名">
                    </div>
                </div>
                <div class="form-group group-play">
                    <span class="control-label col-sm-3 col-xs-5 detail-span"><font color="red">*</font>店铺名称：</span>
                    <div class="col-sm-9 col-xs-7">
                        <input class="form-control" size="30" name="storeName" value="" type="text" maxlength="20">
                    </div>
                </div>
                <div class="form-group group-play">
                    <span class="control-label col-sm-3 col-xs-5 detail-span"><font color="red">*</font>经营范围：</span>
                    <div class="col-sm-9 col-xs-7" id="business">

                    </div>
                </div>
                <div class="form-group group-club">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>头像：</span>
                    <div class="col-sm-9 col-xs-8">
                        <input class="obj-input" name="clubAvatar" value="" type="text">
                        <img class="obj-img" src="" style="display: none" width="100" height="100">
                        <span class="input-file">
                            <input data-image="clubAvatar" type="file" data-action="goods"  onchange="uploadImg(this)">
                        </span>
                        <span class="text-warning">图片最大为3MB，格式为jpg,png.bmp。</span>
                    </div>
                </div>
                <div class="form-group group-club group-camping">
                    <span class="control-label col-sm-3 col-xs-5 detail-span"><font color="red">*</font>负责人姓名：</span>
                    <div class="col-sm-9 col-xs-7">
                        <input class="form-control" size="30" name="legalPerson" value="" type="text" maxlength="10">
                    </div>
                </div>
                <div class="form-group group-club">
                    <span class="control-label col-sm-3 col-xs-5 detail-span"><font color="red">*</font>负责人联系方式：</span>
                    <div class="col-sm-9 col-xs-7">
                        <input class="form-control" size="30" name="legalTel" value="" type="text" maxlength="11">
                    </div>
                </div>
                <div class="form-group group-common">
                    <span class="control-label col-sm-3 col-xs-5 detail-span"><font color="red">*</font>手机号码：</span>
                    <div class="col-sm-9 col-xs-7">
                        <input id="tel" class="form-control" size="30" name="tel" value="" type="text" maxlength="11" placeholder="手机号为账号，请认真填写">
                        <span class="text-warning">（默认密码为 111111）</span>
                        <div class="tel-code">
                            <input id="code" class="form-control" size="10" name="code" value="" type="text" maxlength="6" autocomplete="off" placeholder="短信验证码">
                            <span class="code-btn">获取验证码</span>
                        </div>
                    </div>
                </div>
                <%--<div class="form-group group-common">--%>
                <%--<span class="control-label col-sm-3 col-xs-5 detail-span"><font color="red">*</font>登录密码：</span>--%>
                <%--<div class="col-sm-9 col-xs-7">--%>
                <%--<input id="password" class="form-control" size="30" name="password" value="" type="password" maxlength="18" placeholder="8-20个字符，不能包含空格">--%>
                <%--</div>--%>
                <%--</div>--%>
                <div class="form-group group-trip">
                    <span class="control-label col-sm-3 col-xs-5 detail-span">导游证号：</span>
                    <div class="col-sm-9 col-xs-7">
                        <input class="form-control" size="30" name="guideNum" value="" maxlength="20">
                    </div>
                </div>
                <div class="form-group group-trip">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>有无车：</span>
                    <div class="col-sm-9 col-xs-8">
                        <input type="radio" name="carFlag" value="1"> 有车 &nbsp;&nbsp;&nbsp;&nbsp;
                        <input type="radio" name="carFlag" value="0" checked> 无车
                    </div>
                </div>
                <div class="form-group car-brand">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font><em class="tit-brand">车辆品牌</em>：</span>
                    <div class="col-sm-9 col-xs-8">
                        <input type="text" class="form-control" size="30" name="brandName" value="" maxlength="20">
                    </div>
                </div>
                <div class="form-group group-play group-car group-shop">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>联系人：</span>
                    <div class="col-sm-9 col-xs-8">
                        <input type="text" class="form-control" size="30" name="linkMan" value="" maxlength="20">
                    </div>
                </div>
                <div class="form-group group-play group-car">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>企业电话：</span>
                    <div class="col-sm-9 col-xs-8">
                        <input type="text" class="form-control" size="30" name="companyTel" value="" maxlength="20">
                    </div>
                </div>
                <div class="form-group group-person">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>行驶证：</span>
                    <div class="col-sm-9 col-xs-8">
                        <input class="obj-input" name="driverLicenseUrl" value="" type="text">
                        <img class="obj-img" src="" style="display:none" width="100" height="100">
                        <span class="input-file">
                            <input data-image="driverLicenseUrl" type="file" data-action="goods" onchange="uploadImg(this)">
                        </span>
                    </div>
                </div>
                <!--
                <div class="form-group group-person">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>行驶证编号：</span>
                    <div class="col-sm-9 col-xs-8">
                        <input type="text" class="form-control" size="30" name="driving" value="" maxlength="17">
                    </div>
                </div>
                -->
                <div class="form-group group-trip">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>所在城市：</span>
                    <div class="col-sm-9 col-xs-8">
                        <select id="tripPro" class="form-control" name="tripProvince" value="">
                            <option value="">请选择省份</option>
                        </select>
                        <select id="tripCity" class="form-control"  name="tripCity" value="">
                            <option value="">请选择城市</option>
                        </select>
                        <select id="tripDis" class="form-control"  name="tripArea" value="">
                            <option value="">请选择区/县</option>
                        </select>
                    </div>
                </div>
                <div class="form-group group-common area-box">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>所在城市：</span>
                    <div class="col-sm-9 col-xs-8 area">
                        <jsp:include page="../common/selectCity.jsp">
                            <jsp:param name="proviceVale" value="" />
                            <jsp:param name="provinceName" value="province" />
                            <jsp:param name="cityName" value="city" />
                            <jsp:param name="areaName" value="area" />
                            <jsp:param name="selp" value="selprovince" />
                            <jsp:param name="selc" value="selcity" />
                            <jsp:param name="sela" value="selarea" />
                        </jsp:include>
                    </div>
                </div>
                <div class="form-group group-common">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>详细地址：</span>
                    <div class="col-sm-9 col-xs-8">
                        <input class="form-control" size="50" id="address" value="" maxlength="50" name="address" type="text">
                        <%--<input type="hidden" id="jwd" name="jwd" value="">--%>
                        <%--<button class="btn btn-danger"  onclick="goamap()" type="button"><i class="fa fa-map-marker fa-lg"></i> 点击地图选择详细GPS位置</button>--%>
                        <%--<span class="verify-tip">请点击地图获取详细地址!</span>--%>
                    </div>
                </div>
                <div class="form-group group-play">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>商家性质：</span>
                    <div class="col-sm-9 col-xs-8">
                        <select id="personalCategoryId" name="personalCategoryId" class="form-control">
                            <option value="">请选择</option>
                            <option value="1">个人</option>
                            <option value="2">企业</option>
                        </select>
                    </div>
                </div>
                <div class="form-group group-trip">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font> 性别：</span>
                    <div class="col-sm-9 col-xs-8">
                        <input type="radio" name="sex" value="1" checked> 男 &nbsp;&nbsp;&nbsp;&nbsp;
                        <input type="radio" name="sex" value="0"> 女
                    </div>
                </div>
                <div class="form-group group-trip">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font> 出生年月：</span>
                    <div class="col-sm-9 col-xs-8">
                        <select class="form-control year" name="dateYear" id="dateYear"></select> 年 &nbsp;&nbsp;
                        <select class="form-control mouth" name="dateMouth" id="dateMouth"></select> 月
                        <select class="form-control day" name="dateDay" id="dateDay"></select> 日
                    </div>
                </div>
                <div class="form-group group-trip group-person group-play-per">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>身份证正面照片：</span>
                    <div class="col-sm-9 col-xs-8">
                        <input class="obj-input" name="urlObverse" value="" type="text">
                        <img class="obj-img" src="" style="display:none" width="100" height="100">
                        <span class="input-file">
                            <input type="file" data-action="goods" data-image="urlObverse" onchange="uploadImg(this)">
                        </span>
                        <span class="text-warning">图片最大为3MB，格式为jpg,png.bmp</span>
                    </div>
                </div>
                <div class="form-group group-trip group-person group-play-per">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>身份证反面照片：</span>
                    <div class="col-sm-9 col-xs-8">
                        <input class="obj-input" name="urlBack" value="" type="text">
                        <img class="obj-img" src="" style="display:none" width="100" height="100">
                        <span class="input-file">
                            <input type="file" data-action="goods" data-image="urlBack" onchange="uploadImg(this)">
                        </span>
                        <span class="text-warning">图片最大为3MB，格式为jpg,png.bmp</span>
                    </div>
                </div>
                <div class="form-group group-play-per">
                    <span class="control-label col-sm-3 col-xs-4 detail-span">个人手持身份证照片（选填）：</span>
                    <div class="col-sm-9 col-xs-8">
                        <input class="obj-input" name="IDNumber" value="" type="text">
                        <img class="obj-img" src="" style="display:none" width="100" height="100">
                        <span class="input-file">
                            <input type="file" data-action="goods" data-image="IDNumber" onchange="uploadImg(this)">
                        </span>
                        <span class="text-warning">图片最大为3MB，格式为jpg,png.bmp</span>
                    </div>
                </div>


                <div class="form-group group-club group-shop group-camping group-play-mer">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>营业执照：</span>
                    <div class="col-sm-9 col-xs-8">
                        <%--<input class="form-control input-number" name="licenseCon" value="" type="text" size="30" maxlength="20">--%>
                        <input class="obj-input"  id="licenceUrl" name="licenceUrl" value="" type="text">
                        <img class="obj-img" src="" style="display: none" width="100" height="100">
                        <span class="input-file">
                            <input data-image="licenseImg" type="file" data-action="goods"  onchange="uploadImg(this)">
                        </span>
                        <span class="text-warning">图片最大为3MB，格式为jpg,png.bmp。</span>
                    </div>
                </div>
                <div class="form-group group-play group-car">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>企业形象图：</span>
                    <div class="col-sm-9 col-xs-8">
                        <input class="obj-input" name="banner" value="" type="text">
                        <img class="obj-img" src="" style="display: none" width="100" height="100">
                        <span class="input-file">
                            <input data-image="banner" type="file" data-action="goods"  onchange="uploadImg(this)">
                        </span>
                        <span class="text-warning">图片最大为3MB，格式为jpg,png.bmp。</span>
                    </div>
                </div>
                <div class="form-group group-common avatar-box">
                    <span class="control-label col-sm-3 col-xs-4 detail-span tit-logo"><font color="red">*</font><em>头像</em>：</span>
                    <div class="col-sm-9 col-xs-8">
                        <input class="obj-input" name="avatar" value="" type="text">
                        <img class="obj-img" src="" style="display: none" width="100" height="100">
                        <span class="input-file">
                            <input data-image="avatar" type="file" data-action="goods"  onchange="uploadImg(this)">
                        </span>
                        <span class="text-warning">图片最大为3MB，格式为jpg,png.bmp。</span>
                    </div>
                </div>
                <div class="form-group group-club group-shop group-camping">
                    <span class="control-label col-sm-3 col-xs-4 detail-span">税务登记证：</span>
                    <div class="col-sm-9 col-xs-8">
                        <%--<input class="form-control input-number" name="taxCon" value="" type="text" size="30" maxlength="20">--%>
                        <input class="obj-input"  id="regristUrl" name="regristUrl" value="" type="text">
                        <img class="obj-img" src="" style="display: none" width="100" height="100">
                        <span class="input-file">
                            <input data-image="taxImg" type="file" data-action="goods"  onchange="uploadImg(this)">
                        </span>
                        <span class="text-warning">图片最大为3MB，格式为jpg,png.bmp。</span>
                    </div>
                </div>
                <div class="form-group group-club group-shop group-camping">
                    <span class="control-label col-sm-3 col-xs-4 detail-span">组织机构代码：</span>
                    <div class="col-sm-9 col-xs-8">
                        <%--<input class="form-control input-number" name="orgCon" value="" type="text" size="30" maxlength="20">--%>
                        <input class="obj-input"  id="organizeUrl" name="organizeUrl" value="" type="text">
                        <img class="obj-img" src="" style="display: none" width="100" height="100">
                        <span class="input-file">
                            <input data-image="orgImg" type="file" data-action="goods"  onchange="uploadImg(this)">
                        </span>
                        <span class="text-warning">图片最大为3MB，格式为jpg,png.bmp。</span>
                    </div>
                </div>
                <div class="form-group group-shop">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>品牌：</span>
                    <div class="col-sm-9 col-xs-7">
                        <button class="btn btn-yellow" id="brandName" onclick="searchBrand()" type="button">添加品牌</button>
                        <input id="brandId" type="text" name="brands" value="" style="opacity: 0;" />
                    </div>
                </div>
                <div class="form-group group-shop" id="brandDivParent" >
                    <span class="control-label col-sm-3 col-xs-4 detail-span">已添加品牌：</span>
                    <div class="col-sm-9 col-xs-7" id="brandDiv">

                    </div>
                </div>
                <div class="form-group group-shop">
                    <span class="control-label col-sm-3 col-xs-5 detail-span"><font color="red">*</font>店铺名称：</span>
                    <div class="col-sm-9 col-xs-7">
                        <input class="form-control" size="30" name="shopName" value="" type="text" maxlength="20">
                    </div>
                </div>
                <div class="form-group group-club group-car group-person">
                    <span class="control-label col-sm-3 col-xs-4 detail-span tit-remark"><em>企业介绍</em>：</span>
                    <div class="col-sm-9 col-xs-8">
                        <textarea class="form-control" name="remark" cols="50" rows="6" placeholder="最多输入200字" maxlength="200"></textarea>
                    </div>
                </div>
                <%--<div class="form-group">--%>
                    <%--<span class="control-label col-sm-3 col-xs-4 detail-span">企业介绍：</span>--%>
                    <%--<div class="col-sm-9 col-xs-8">--%>
                        <%--<textarea class="form-control" name="detailImages[0].path" cols="50" rows="6" placeholder="最多输入1800字" maxlength="1800"></textarea>--%>
                    <%--</div>--%>
                <%--</div>--%>
                <!--<div class="form-group group-play">
                    <span class="control-label col-sm-2 col-xs-4 detail-span"><font color="red">*</font>企业介绍：</span>
                    <div class="col-sm-10 col-xs-8 add-box image-text">
                        <div class="text-box">
                            <textarea data-id="0" name='detailImages[0].path' id="text0" maxlength="1900"
                                      class="form-control"></textarea>
                            <input class='sort' name='detailImages[0].sort' value="0" type="hidden"/>
                            <input name='detailImages[0].type' value="1" type="hidden"/>
                        </div>
                        <div class="text-box">
                            <div class="upload-box">
                                <input class="obj-input" name="detailImages[1].path" value="" type="hidden">
                                <img class="obj-img" src="" style="display:none">
                                <span class="input-file">
                                <input data-id="1" type="file" id="upimg1" data-image="detailImages[1].path" data-action="goods"
                                       onchange="uploadImg(this)" class="no text field">
                            </span>
                                <input class='sort' name='detailImages[1].sort' value="1" type="hidden"/>
                                <input name='detailImages[1].type' value="2" type="hidden"/>
                            </div>
                        </div>
                    </div>
                </div>-->
                <div class="form-group group-play">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>企业介绍：</span>
                    <div class="col-sm-9 col-xs-8 add-box image-text">
                        <div class="text-box">
                            <textarea data-id="0" name='detailImages[0].path' id="text0" maxlength="1900" rows="3" cols="50" class="form-control" placeholder="最多输入1800字"></textarea>
                            <input class="sort" name='detailImages[0].sort' value="0" type="hidden"/>
                            <input name='detailImages[0].type' value="1" type="hidden"/>
                        </div>
                        <div class="text-box">
                            <div class="upload-box">
                                <input class="obj-input" name="detailImages[1].path" value="" type="hidden">
                                <img class="obj-img" src="" style="display:none">
                                <span class="input-file">
                                    <input data-id="1" type="file" id="upimg1" data-action="goods" data-image="detailImages[1].path" class="no text field" onchange="uploadImg(this)">
                                </span>
                                <input class="sort" name='detailImages[1].sort' value="1" type="hidden"/>
                                <input name='detailImages[1].type' value="2" type="hidden"/>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="form-group group-shop">
                    <span class="control-label col-sm-3 col-xs-4 detail-span">店铺描述：</span>
                    <div class="col-sm-9 col-xs-8">
                        <textarea class="form-control" name="shopRemark" cols="50" rows="6" placeholder="您可以简短介绍下您的店铺" maxlength="200"></textarea>
                    </div>
                </div>

                <div class="form-group group-trip">
                    <span class="control-label col-sm-3 col-xs-4  detail-span"><font color="red">*</font>&nbsp;个人爱好：</span>
                    <div class="col-sm-9 col-xs-8">
                        <input id="hobby1" type="text" class="form-control" size="10" name="hobby" value="" maxlength="10">
                        <input type="text" class="form-control" size="10" name="hobby" value="" maxlength="10">
                        <input type="text" class="form-control" size="10" name="hobby" value="" maxlength="10">
                    </div>
                </div>
                <div class="form-group group-trip">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>&nbsp;自我评价：</span>
                    <div class="col-sm-9 col-xs-8">
                        <div id="star" style="height: 30px;"></div>
                        <span class="verify-tip">请设置自我评价</span>
                    </div>
                </div>
                <div class="form-group group-trip">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>&nbsp;简介：</span>
                    <div class="col-sm-9 col-xs-8">
                        <div class="text-box">
                            <textarea name="instrCon" maxlength="500" rows="4" cols="55" class="form-control"></textarea>
                        </div>
                        <div class="inputfile-img-box">
                            <input class="obj-input" name="instrImg" value="" type="text">
                            <img class="obj-img" src="" style="display:none">
                            <span class="input-file">
                            <input data-image="instrImg" type="file" data-action="goods" onchange="uploadImg(this)">
                        </span>
                        </div>
                        <div class="add-inputfile add-inputfile1">
                            <i class="fa fa-plus"></i>
                        </div>
                        <span class="text-warning">至少1张，至多4张；图片大小不能超过3MB，图片格式为750*410px为最佳。</span>
                    </div>
                </div>
                <div class="form-group group-trip">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>&nbsp;性格：</span>
                    <div class="col-sm-9 col-xs-8">
                        <div class="text-box">
                            <textarea name="natureCon" maxlength="500" rows="4" cols="55" class="form-control"></textarea>
                        </div>
                        <div class="inputfile-img-box">
                            <input class="obj-input" name="natureImg" value="" type="text">
                            <img class="obj-img" src="" style="display:none">
                            <span class="input-file">
                            <input data-image="natureImg" type="file" data-action="goods" onchange="uploadImg(this)">
                        </span>
                        </div>
                        <div class="add-inputfile add-inputfile2">
                            <i class="fa fa-plus"></i>
                        </div>
                        <span class="text-warning">至少1张，至多4张；图片大小不能超过3MB，图片格式为750*410px为最佳。</span>
                    </div>
                </div>
                <div class="form-group group-trip">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>&nbsp;擅长：</span>
                    <div class="col-sm-9 col-xs-8">
                        <div class="text-box">
                            <textarea name="goodCon" maxlength="500" rows="4" cols="55" class="form-control"></textarea>
                        </div>
                        <div class="inputfile-img-box">
                            <input class="obj-input" name="goodImg" value="" type="text">
                            <img class="obj-img" src="" style="display:none">
                            <span class="input-file">
                            <input data-image="goodImg" type="file" data-action="goods" onchange="uploadImg(this)">
                        </span>
                        </div>
                        <div class="add-inputfile add-inputfile3">
                            <i class="fa fa-plus"></i>
                        </div>
                        <span class="text-warning">至少1张，至多4张；图片大小不能超过3MB，图片格式为750*410px为最佳。</span>
                    </div>
                </div>
                <div class="form-group group-trip">
                    <span class="control-label col-sm-3 col-xs-4 detail-span"><font color="red">*</font>&nbsp;服务：</span>
                    <div class="col-sm-9 col-xs-8">
                        <div class="text-box">
                            <textarea name="serviceCon" maxlength="500" rows="4" cols="55" class="form-control"></textarea>
                        </div>
                        <div class="inputfile-img-box">
                            <input class="obj-input" name="serviceImg" value="" type="text">
                            <img class="obj-img" src="" style="display:none">
                            <span class="input-file">
                            <input data-image="serviceImg" type="file" data-action="goods" onchange="uploadImg(this)">
                        </span>
                        </div>
                        <div class="add-inputfile add-inputfile4">
                            <i class="fa fa-plus"></i>
                        </div>
                        <span class="text-warning">至少1张，至多4张；图片大小不能超过3MB，图片格式为750*410px为最佳。</span>
                    </div>
                </div>

            </div>
            <div class="form-group">
                <span class="control-label col-sm-3 col-xs-4 detail-span"></span>
                <div class="col-sm-9 col-xs-8">
                    <input type="checkbox" name="tips" value=""><span class="layTips">请阅读并同意商家入驻协议！</span>
                </div>
            </div>
        </form>
    </div>
    <div class="form-group bot-btn">
        <button type="button" class="btn btn-success" onclick="submitForm()">提交申请</button>
    </div>
</div>

<script src="${basePath}/bootstrap/js/jquery.js" type="text/javascript"></script>
<script src="${basePath}/bootstrap/js/common.js" type="text/javascript"></script>
<script src="${basePath}/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="${basePath}/bootstrap/plugin/layer/layer.js" type="text/javascript"></script>
<script src="http://cdn.bootcss.com/blueimp-md5/1.1.0/js/md5.js"></script>
<script type="text/javascript" src="https://cdn.bootcss.com/bootstrap-validator/0.5.3/js/bootstrapValidator.min.js"></script>
<script type="text/javascript" src="https://cdn.bootcss.com/bootstrap-validator/0.5.3/js/language/zh_CN.js"></script>
<script type="text/javascript">
    $(window).bootstrapValidator || document.write('<script src="${basePath}/bootstrap/js/bootstrapValidator.min.js"><\/script>');
</script>
<script src="${basePath}/bootstrap/js/lzy.tenants.js" type="text/javascript"></script>
<script src="${basePath}/bootstrap/plugin/jquery.raty.min.js" type="text/javascript"></script>
<script src="${basePath}/bootstrap/js/campsite-play.js" type="text/javascript"></script>
<script>
    var mark = 0;
    $(function(){
        var domain = "http://lzyapp.ssl.lzyhll.com/share/pages/agreement/register/";
        var urlArr = [
            "play-with-you.html",//默认
            "play-with-you.html",//旅游创客
            "what-to-play.html",//玩什么
            "travel-together.html",//商城商家 -- 协议待定
            "rv-club.html",//房车俱乐部
            "rv-club.html",//个人房车
            "rv-brands.html",//房车厂商
            "campsite.html"//露营地
        ];
        var box = $(".group-box");
        $("#module").val("");
        $("#module").change(function(){
            box.show();
            box.find(".form-group").hide();//重置
            box.find(".group-common").show();
            $(this).find("option").each(function(){
                var _this = $(this).attr("data-name");
                if($(this).is(":selected")){
                    $("."+_this).show();
                }
            });
            //清空值
            $(".group-box input").not("input[type='radio']").not("input[type='checkbox']").not("input[type='hidden']").each(function(){
                $(this).val("");
            });
            $(".group-box textarea").each(function(){
                $(this).val("");
            });

            //头像/logo
            var logoTit = $(".tit-logo em");
            var brandTit = $("em.tit-brand");
            var remarkTit = $(".tit-remark em");
            var val = $(this).val();
            var brand = $(".car-brand");
            var areaBox = $(".area-box");
            if(val == "2" || val == "4"){
                logoTit.html("LOGO");
            }
            else if(val == "6"){
                logoTit.html("品牌标志图");
                brandTit.html("房车品牌");
                remarkTit.html("企业介绍");
                brand.show();
            }
            else if(val == "3" || val == "7"){
                $(".avatar-box").hide();
            }
            else if(val == "5"){
                remarkTit.html("简介");
            }
            else if(val == ""){
                box.hide();
            }
            else{
                logoTit.html("头像");
                brandTit.html("车辆品牌");
                remarkTit.html("企业介绍");
                brand.hide();
            }
            if(val == "4"){ mark = "2"}
            else if(val == "5"){ mark = "1"}
            else{ mark = 0}

            if(val == "1"){
                areaBox.hide();
            }
            else{
                areaBox.show();
            }

            //有无车
            //var car = $(".car-brand");
            $("input[name='carFlag']").off("change").change(function () {
                if ($(this).val() == "0") {
                    brand.hide();
                }
                else {
                    brand.show();
                }
            });

            if(val == "2"){
                $.ajax({
                    type:"GET",
                    url:"${basePath}/merchant/play/json",
                    dataType:"json",
                    data:{},
                    success:function(data){
                        var temp = '';
                        for(var i=0,len=data.length;i<len;i++){
                            temp += '<label><input type="checkbox" name="categoryIds" value="'+data[i][0]+'">'+data[i][1]+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>'
                        }
                        $("#business").append(temp);
                    },
                    error:function(){
                        console.log("请求失败")
                    }
                })
            }

        });
        //商家性质选择
        $('#personalCategoryId').change(function(){
            var biztype = $(this).val();
            if(biztype==1){
                $('.group-play-per').show();
                $('.group-play-mer').hide();
            }else if(biztype==2){
                $('.group-play-per').hide();
                $('.group-play-mer').show();
            }else{
                $('.group-play-per').hide();
                $('.group-play-mer').hide();
            }
        });
        //弹出协议
        $(".layTips").click(function(){
            var tipUrl = domain+urlArr[$("#module").val() || 0];
            layer.open({
                type: 2,
                area: ['850px','95%'],
                title: ['商家入驻协议','text-align:center;font-weight:bold;background:#fff;'],
                content: [tipUrl,'yes']
            });
        });

        //选择年份/月份
        var $year,$mouth,$day;
        for (var i = 1960; i < 2017; i++) {
            $year += "<option value='" + i + "'>" + i + "</option>"
        }
        for (var j = 1; j <= 12; j++) {
            if (j < 10) {
                j = "0" + j
            }
            $mouth += "<option value='" + j + "'>" + j + "</option>"
        }
        for (var k = 1; k <= 31; k++) {
            if (k < 10) {
                k = "0" + k
            }
            $day += "<option value='" + k + "'>" + k + "</option>"
        }
        $("select.year").append($year);
        $("select.mouth").append($mouth);
        $("select.day").append($day);

        //验证码
        $(".code-btn").click(function(){
            var tel = $("#tel").val();
            if(!regTel.test(tel)){
                alert("请输入正确的手机号码");
                return false;
            }
            else{
                getCode(tel);
            }

        });

        //省市县
        var proval = "";
        initTrip(proval);

        //评分 name = score
        $.fn.raty.defaults.path = '${basePath}/bootstrap/images/star';
        $('#star').raty();
        //$('#myForm').bootstrapValidator('addField', $("input[name='score']"));
        $("input[name='score']").val("1").mouseout();//默认值1;

        //var tip = $(".verify-tip");
        $('#star').mouseout(function(){
            if($("input[name='score']").val() == ""){
                $(this).siblings(".verify-tip").show();
            }
            else{
                $(this).siblings(".verify-tip").hide();
            }
        })


    });

    function submitForm() {
        $("#shopId").val($("#module option:selected").attr("data-id"));
        $("#password").val( md5($("#password").val()));
        var bsVal = $("#myForm").data('bootstrapValidator');
        bsVal.validate();
        if(bsVal.isValid() && $(".verify-tip:visible").length == 0){
            //校验验证码
            var tel = $("#tel").val();
            var code = $("#code").val();
            var timer;
            function gotoPage(){
                clearInterval(timer);
                window.location.href="${basePath}/merchant/success?phone="+tel;
            }
            if(code==""){
                alert("请输入验证码！")
            }
            else{
                $.ajax({
                    type: 'GET',
                    url: '${basePath}/merchant/verifyCode?account='+tel+'&imageCodeType=41&authCode='+code+'',
                    dataType: 'json',
                    cache: false,
                    success: function(data) {
                        if(data.code == "0"){
                            //提交
                            var btn = $(".btn-success");
                            $.ajax({
                                type : 'POST',
                                dataType: 'json',
                                url:  '${basePath}/merchant/businessesIn?sourceType=2&mark=' + mark,
                                data: $("#myForm").serialize(),
                                beforeSend:function(){
                                    btn.prop("disabled","true").css("background-color","#ccc");
                                    layer.load(2);
                                },
                                success: function (data) {
                                    if(data.code == "0"){
                                        layer.alert("提交成功", {
                                            icon : 1
                                        },function(){
                                            window.location.href="${basePath}/merchant/success?phone="+tel;
                                        });
                                        timer = setInterval(gotoPage,1000);
                                        //清空值
                                        $(".group-box input").not("input[type='radio']").not("input[type='checkbox']").not("input[type='file']").each(function(){
                                            $(this).val("");
                                        });
                                        $(".group-box textarea").each(function(){
                                            $(this).val("");
                                        });
                                        $("#module").val("");
                                    }else{
                                        layer.alert(data.desc, {
                                            icon : 5
                                        },function(){
                                            layer.closeAll();
                                        });
                                    }
                                },
                                complete:function(){
                                    layer.closeAll('loading');
                                    btn.removeAttr("disabled").css("background-color","#5cb85c");
                                },
                                error: function(){
                                    layer.alert('系统错误', {
                                        icon : 5
                                    });
                                }
                            }).done(function(){

                            });
                        }
                        else{
                            alert("验证码错误")
                        }
                    },
                    error: function(){
                        console.log("请求失败")
                    }
                })
            }
        }
        else{
            var smallTop = $("small:visible").eq(0).offset().top - 50;
            $("html,body").animate({scrollTop:smallTop},300);
        }
    }

    //表单验证
    $('#myForm').bootstrapValidator({
        fields: {
            type: {
                validators: {
                    notEmpty: {
                        message: '请选择申请身份类型'
                    }
                }
            },
            name: {
                validators: {
                    notEmpty: {
                        message: '请输入姓名'
                    }
                }
            },
            idCardNo: {
                validators: {
                    notEmpty: {
                        message: '请输入身份证号码'
                    },
                    regexp: {
                        regexp: regId,
                        message: '请输入正确的身份证号码'
                    }
                }
            },
            tel: {
                validators: {
                    notEmpty: {
                        message: '请输入手机号码'
                    },
                    regexp: {
                        regexp: regTel,
                        message: '请输入正确的手机号码'
                    }
                }
            },
            code: {
                validators: {
                    notEmpty: {
                        message: '请输入短信验证码'
                    },
                    regexp: {
                        regexp: regNumber,
                        message: '请输入数字'
                    }
                }
            },
            brandName: {
                validators: {
                    notEmpty: {
                        message: '请输入品牌'
                    }
                }
            },
            area: {
                validators: {
                    notEmpty: {
                        message: '请选择所在城市'
                    }
                }
            },
            tripCity: {
                validators: {
                    notEmpty: {
                        message: '请选择所在城市'
                    }
                }
            },
            address: {
                validators: {
                    notEmpty: {
                        message: '请输入详细地址'
                    }
                }
            },
            urlObverse: {
                trigger:"change",
                validators: {
                    notEmpty: {
                        message: '请上传身份证正面照片'
                    }
                }
            },
            urlBack: {
                trigger:"change",
                validators: {
                    notEmpty: {
                        message: '请上传身份证反面照片'
                    }
                }
            },
            avatar: {
                trigger:"change",
                validators: {
                    notEmpty: {
                        message: '请上传图片'
                    }
                }
            },
            banner: {
                trigger:"change",
                validators: {
                    notEmpty: {
                        message: '请上传企业形象图'
                    }
                }
            },
            licenceUrl: {
                trigger:"change",
                validators: {
                    notEmpty: {
                        message: '请上传营业执照'
                    }
                }
            },
            companyName: {
                validators: {
                    notEmpty: {
                        message: '请输入企业名称'
                    }
                }
            },
            storeName: {
                validators: {
                    notEmpty: {
                        message: '请输入店铺名称'
                    }
                }
            },
            linkMan: {
                validators: {
                    notEmpty: {
                        message: '请输入联系人'
                    }
                }
            },
            companyTel: {
                validators: {
                    notEmpty: {
                        message: '请输入企业电话'
                    },
                    regexp: {
                        regexp: regPhone,
                        message: '请输入座机 如0571-87371000 或11位手机号'
                    }
                }
            },
            legalPerson: {
                validators: {
                    notEmpty: {
                        message: '请输入负责人姓名'
                    }
                }
            },
            legalTel: {
                validators: {
                    notEmpty: {
                        message: '请输入负责人联系方式'
                    },
                    regexp: {
                        regexp: regTel,
                        message: '请输入正确的手机号码'
                    }
                }
            },
            licenseCon: {
                validators: {
                    notEmpty: {
                        message: '请输入营业执照号'
                    },
                    regexp: {
                        regexp: regCerty,
                        message: '请输入不少于10位数字或字母的证件号码'
                    }
                }
            },
            driverLicenseUrl: {
                trigger:"change",
                validators: {
                    notEmpty: {
                        message: '请上传行驶证照片'
                    }
                }
            },
            modules: {
                validators: {
                    notEmpty: {
                        message: '请选择所属板块'
                    }
                }
            },
            brands: {
                trigger:"change",
                validators: {
                    notEmpty: {
                        message: '请添加品牌'
                    }
                }
            },
            shopName: {
                validators: {
                    notEmpty: {
                        message: '请输入店铺名称'
                    }
                }
            },
            tips: {
                validators: {
                    notEmpty: {
                        message: '请阅读并同意商家入驻协议'
                    }
                }
            },
            hobby: {
                selector: '[id="hobby1"]',
                validators: {
                    notEmpty: {
                        message: '请至少输入一个爱好'
                    }
                }
            },
            instrCon: {
                validators: {
                    notEmpty: {
                        message: '请输入简介'
                    }
                }
            },
            instrImg: {
                trigger:"change",
                validators: {
                    notEmpty: {
                        message: '请上传简介图片'
                    }
                }
            },
            natureCon: {
                validators: {
                    notEmpty: {
                        message: '请输入性格'
                    }
                }
            },
            natureImg: {
                trigger:"change",
                validators: {
                    notEmpty: {
                        message: '请上传性格图片'
                    }
                }
            },
            goodCon: {
                validators: {
                    notEmpty: {
                        message: '请输入擅长'
                    }
                }
            },
            goodImg: {
                trigger:"change",
                validators: {
                    notEmpty: {
                        message: '请上传擅长图片'
                    }
                }
            },
            serviceCon: {
                validators: {
                    notEmpty: {
                        message: '请输入服务'
                    }
                }
            },
            serviceImg: {
                trigger:"change",
                validators: {
                    notEmpty: {
                        message: '请上传服务图片'
                    }
                }
            },
            personalCategoryId: {
                trigger:"change",
                validators: {
                    notEmpty: {
                        message: '请选择商家性质'
                    }
                }
            },
            'detailImages[0].path': {
                validators: {
                    notEmpty: {
                        message: '请输入企业介绍'
                    }
                }
            }
        }
    });
</script>
</body>
</html>